﻿{% extends "layout.html" %}


{% block title %}
<title></title>
{% endblock %}

{% block style %}
{% endblock %}


{% block li %}
       <li><a href="content.html">内容</a></li>
        <li>布置作业</li>
{% endblock %}

{% block content %}
    <div class="admin">
        <div class="tab-body">
					<br />
					<div class="tab-panel active" id="tab-set">
						<form method="post" class="form-x" action="/fix_up.html/">
							<div class="form-group">
								<div class="field">
									<input type="text" class="input"  name="aName" size="50" placeholder="作业名称" data-validate="required:请填写你作业名称" />
								    <input type="hidden" name="username" value="{{username}}">
                                </div>
							</div>
							<div class="form-group">
								<div class="field">
									<textarea class="input" name ="assignment" rows="2" cols="50" placeholder="布置你要出的题目" data-validate="required:请填写题目"></textarea>
								</div>
                                <div id="add"></div>
							</div>
                            <div class="form-group">
								<div class="field">
									<select class="select picker" name="subjectId">
                                        <option>=== 请选学科 ===</option>
                                        {% for each in cls %}
                                        <option value=" {{each.subId }}">{{ each.subId }}</option>
                                        {% endfor %}
                                    </select>
								</div>
							</div>
                         <div class="form-group">
								<div class="field">
									<select class="select picker" name="clsId">
                                        <option>=== 请选班级 ===</option>
                                        {% for each in c %}
                                        <option value=" {{each.clsId }}">{{ each.clsName }}</option>
                                        {% endfor %}
                                    </select>
								</div>
							</div>
							<div class="form-group">
								<div class="field">
									<input type="date" class="input" name="time" size="50" placeholder="截止时间" data-validate="required:截止时间" />
								</div>
							</div>
							<div class="form-button">
                                <span  class="button bg-main"  onclick="add_problem()">继续出题</span>
								<button class="button bg-main" type="submit">提交</button>
							</div>
						</form>
					</div>
				</div >
    </div>

{% endblock %}

{% block js %}
       <script>
        $(function () {
            $('#test').addClass('active')
            $('#home').removeClass('active')
        });
        var i = 1
        var add_problem = function () {
            i += 1
            $("#add").before(
                '<div class="field" style="padding-top:15px;">'+
                     '<textarea class="input" name ="assignment" rows="2" cols="50" placeholder="布置你要出的题目" data-validate="required:请填写题目"></textarea>'+
                '</div>'
            )
        }
    </script>
{% endblock %}